/**
 * Created by zhaiyunzhi on 2017/1/3.
 */
import api from './config'

export function createMarketActivity(param) {
    return api.post('api/market_activity/createMarketActivity',{
        dealer_id:param.dealer_id,
        sale_user_id:param.sale_user_id,
        expect_start_time:param.expect_start_time,
        start_time:param.start_time,
        type:param.type,
        description:param.description,
        expect_amount:param.expect_amount,
        amount:param.amount
    });
}

export function updateMarketActivity(param) {
    return api.post('api/market_activity/updateMarketActivity',{
        market_activity_id:param.market_activity_id,
        dealer_id:param.dealer_id,
        sale_user_id:param.sale_user_id,
        expect_start_time:param.expect_start_time,
        start_time:param.start_time,
        type:param.type,
        description:param.description,
        expect_amount:param.expect_amount,
        amount:param.amount
    });
}

export function deleteMarketActivity(market_activity_id) {
    return api.post('api/market_activity/deleteMarketActivity',{
       market_activity_id:market_activity_id
    });
}

export function getList(param) {
    return api.post('api/market_activity/getList',{
       page_index:param.page_index,
       page_size:param.page_size,
       dealer_id:param.dealer_id,
       sale_user_id:param.sale_user_id,
       state:param.state
    });
}

export function getDetail(market_activity_id) {
    return api.post('api/market_activity/getDetail',{
        market_activity_id:market_activity_id
    });
}

export function switchState(market_activity_id,state) {
    return api.post('api/market_activity/switchState',{
        market_activity_id:market_activity_id,
        state:state
    });
}

